<?php
namespace Novel\Model;

use Zend\Db\Adapter\Adapter;
use Zend\Db\Adapter\AdapterAwareInterface;
use Zend\Db\TableGateway\AbstractTableGateway;

class NovelTable extends AbstractTableGateway implements AdapterAwareInterface
{
    //light novel table
    protected $table="novel";
    public function setDbAdapter(Adapter $adapter)
    {
        $this->adapter=$adapter;
    }

    /**
     * 创建小说
     * @param $data
     * @return int
     *
     */
    public function create($data){
        return $this->insert($data);

    }

    /**
     * 获取当前ID小说
     * @param $id
     * @return \Zend\Db\ResultSet\ResultSet
     *
     */
    public function getById($id){
        return $this->select(array("nid"=>$id));
    }




}